{% extends "kitchen/dashboard_base.html" %}

{% load compile_static %}
{% load static %}

{% block cssincludes %}
<link href="{% static 'menu.scss'|compile %}" rel="stylesheet" type="text/css" />
{% endblock %}

{% block content %}

<h2>Ingredients</h2>

<br />

<a href="{% url "menu_ingredient_create" %}" class="btn btn-primary">Create</a>

<br /><br />

<table class="ingredient-page-list table">
    <thead>
        <tr>
            <th>Ingredient</th>
            <th>Tools</th>
        </tr>
    </thead>
    <tbody>
        {% for ingredient in ingredients %}
            <tr>
                <td>
                    <span class="ingredient-title">{{ ingredient.name }}</span>
                    {% if ingredient.description|length > 0 %}
                    <br />
                        {{ ingredient.description }}
                    {% endif %}
                </td>
                <td>
                    <a href="{% url "menu_ingredient_edit" ingredient.id %}" class="btn btn-secondary">Edit</a>
                </td>
            </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock %}
